def fun():
    num = int(input('请输入一个十进制的整数：'))  
    print(f'{num}的二进制数为：{bin(num)}')
    print(f'{num}的八进制数为：{oct(num)}')
    print(f'{num}的十六进制数为：{hex(num)}')

if __name__ == '__main__':
    while True:
        try:
            fun()
            break
        except:
            print('只能输入整数！程序出错，请重新输入')